#include <QApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include "logcatclient.h"
#include "logmodel.h"
#include <QDebug>
#include "Tools.h"

int main(int argc, char *argv[])
{
//    QStringList list;
//    list << "Bill Murray" << "John Doe" << "Bill Clinton" << "";

//    QStringList result;
//    result = list.filter("Bill");
//    qDebug() << result;
//    qDebug() << list.contains("");
//    return 0;
    QApplication app(argc, argv);

    LogCatClient client(&app);
    LogModel logmodel;
    QObject::connect(&client, SIGNAL(newLog(LogItem)), &logmodel, SLOT(add(LogItem)));
    QQmlApplicationEngine engine;
    Tools tools;
    engine.rootContext()->setContextProperty("gLogModel", &logmodel);
    engine.rootContext()->setContextProperty("gLogCatClient", &client);
    engine.rootContext()->setContextProperty("gTools", &tools);
    engine.load(QUrl(QStringLiteral("qrc:/main.qml")));

    return app.exec();
}
